#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

const int maxn = 1e6 + 2000;
int a[maxn] = {1, 2, -1, 3, -2};//
int dp[maxn];//dp[i]��a[i]��β����������еĺ� 
int n = 5;


int main() {
    dp[0] = a[0];
    for (int i = 1; i < n; i++) {
        dp[i] = max(a[i], dp[i - 1] + a[i]);
    }
    sort(dp, dp + n);
    cout << dp[n - 1];
}
